<?php session_start();

if (!isset($_SESSION["txt_login"]))
{ print "<script type = 'text/javascript'> location.href = 'index.php'</script>"; exit();}

include "../conexao.php";
$id_noticias   = $_GET["id_noticias"];
$acao       = $_GET["acao"];
$maximo     = $_GET["maximo"];
$pagina     = $_GET["pagina"];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="estilo_admin.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js" charset="utf-8"></script>

<script type="text/javascript">
<!--
tinyMCE.init({
	// General options
	mode : "textareas",
	theme : "advanced",
	plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

	// Theme options
	theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
	theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
	theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : true,

	// Example content CSS (should be your site CSS)
	content_css : "css/example.css",

	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "js/template_list.js",
	external_link_list_url : "js/link_list.js",
	external_image_list_url : "js/image_list.js",
	media_external_list_url : "js/media_list.js",

	// Replace values for the template plugin
	template_replace_values : {
		username : "Some User",
		staffid : "991234"
	}
});</script>
</head>

<body><?php 
$sql = mysql_query("SELECT * FROM noticias WHERE id_noticias='$id_noticias'");
$linha=mysql_fetch_array($sql);

?>
<table width="100%" border="0">
  <tr>
    <td><form action="op_lstnoticiasadmin.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
      <table width="100%" border="0">
        <tr>
          <td width="10%"  class="meio"><strong>T&iacute;tulo</strong></td>
          <td colspan="2"  class="meio"><label>
            <textarea name="titulo" cols="120" id="titulo"><?php echo $linha["titulo"]; ?></textarea>
          </label></td>
          <td width="13%">&nbsp;</td>
        </tr>
        <tr>
          <td  class="meio"><strong>Descri&ccedil;&atilde;o</strong></td>
          <td colspan="2"  class="meio"><label>
            <textarea name="descricao" cols="120" rows="20" id="descricao"><?php echo $linha["descricao"]; ?></textarea>
          </label></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="meio"><div align="center"><strong>Foto</strong></div></td>
          <td width="27%" class="meio">
            <label>
            <input type="file" name="nome_arquivo" id="nome_arquivo" />
            </label></td>
          <td width="50%" class="meio"><div align="center"><img src="../banner/<?php echo $linha["foto"];?>" width="155" height="120"/></div></td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td>&nbsp;</td>
          <td colspan="2">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td colspan="2"><label>
            <input type="submit" name="button" id="button" value="<?php echo $acao;?>" />
            <input name="acao" type="hidden" id="acao" value="<?php echo $acao?>" />
            <input name="id_noticias" type="hidden" id="id_noticias" value="<?php echo $linha["id_noticias"];?>"/>
            <input name="pagina" type="hidden" id="pagina" value="<?php echo $pagina;?>" />
            <input name="maximo" type="hidden" id="maximo" value="<?php echo $maximo;?>" />
            <input name="foto" type="hidden" id="foto" value="<?php echo $linha["foto"];?>" />
          </label></td>
          <td>&nbsp;</td>
        </tr>
      </table>
        </form>
    </td>
  </tr>
</table>
</body>
</html>
